<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">  
    <title>校园一卡通</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="o n">
    <meta name="format-detection" content="telephone=no">
   <link rel="stylesheet" href="/assets/store/bound/css/style.css">
    <link rel="stylesheet" href="/assets/store/bound/css/layer.css">
</head>
<body>
<div class="wraper">
    <div class="header">
        <a href="javascript:history.go(-1)" class="iconfont icon-zuo back"></a>
        <div class="title text-center font-16">个人中心</div>
    </div>
    <div class="main-card">
        <div class="user flex">
            <div class="logo">
                <img src="/assets/store/bound/images/logo.png" alt="">
            </div>
            <div>
                <p>校园卡</p>
                <p class="font-12 Student_ID">{BEESCRM:$data.number}</p>
            </div>
              <div>
                <p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
            </div>
            <div>
                <p>学生账号</p>
                <p class="font-12 Student_ID1">{BEESCRM:$data.number2}</p>
            </div>
        </div>
        <div class="text-right font-16" style="display: none">
            余额 <span>0.00</span> 元
        </div>
        <div class="bg-logo">
            <img src="/assets/store/bound/images/logo.png" alt="">
        </div>
    </div>
       <div class="classify">
            <a href="#" class="list flex-between gray js_unbundle" >
                <div class="iconfont icon-logo icon-bangqiajiebangwenti font-20"></div>
                <div class="right flex-between">
                    <div>解绑</div>
                    <div class="iconfont  icon-jiantou"></div>
                </div>
            </a>

        </div>
         <div class="pop-box hide">
            <div class="pop-hint text-center">
                <div class="top"></div>
                <div class="pop-title font-16">
                    解绑密码
                </div>
                <div class="password">
                    <input type="text" id="password" class="text-center" placeholder="请输入解绑密码">
                </div>
                <a href="#" class="btn text-center btn-ok">确定</a>
                <p class="font-12 gray"><span class="red">注：</span>您正在对您的校园卡进行解绑操作</p>
                <div class="close iconfont icon-chacha1">
                </div>
            </div>
        </div>
    <input type="hidden" id="account_id" value="{BEESCRM:$account_id}" />
</div>
</body>
<script src="/assets/store/bound/js/jquery-2.1.0.min.js"></script>
<script src="/assets/store/bound/js/layer.js"></script>
<script src="/assets/store/bound/js/public.js"></script>
<script>
    var height=$(window).height();
    $('.wraper').css('minHeight',height);

    $(function () {
        var Student_ID = $('.Student_ID').text();
        var lenght = Student_ID.length;
        if (lenght > 8) {
            var lenght2 = lenght - 8;
            var text1 = Student_ID.substr(0, 4);
            var text2 = Student_ID.substring(lenght - 4, lenght);
            var value = '';
            for (var i = 1; i <= lenght2; i++) {
                value += '*';
            }
            $(".Student_ID").html(text1 + value + text2);
        }

        var Student_ID1 = $('.Student_ID1').text();
        var lenght_number = Student_ID1.length;
        if (lenght_number > 8) {
            var lenght2_number = lenght_number - 8;
            var text1_number = Student_ID1.substr(0, 4);
            var text2_number = Student_ID1.substring(lenght_number - 4, lenght_number);
            var value_number = '';
            for (var i = 1; i <= lenght2_number; i++) {
                value_number += '*';
            }
            $(".Student_ID1").html(text1_number + value_number + text2_number);
        }

        $('.js_unbundle').click(function () {
            $('.pop-box').removeClass('hide');
        });
        $('.close').click(function () {
            $('.pop-box').addClass('hide');
        });
        $('.btn-ok').click(function () {
            var account_id = $('#account_id').val();
            var password = $("#password").val();
            if (!password) {
                fm.alert("请输入解绑密码");
                return false;
            }
            $.ajax({
                url: "/base/CampusCard/unbound/account_id/" + account_id,
                type: 'post',
                dataType: 'json',
                data: {password: password},
                success: function (res) {
                    if (res.status == 'S') {
                        fm.alert(res.message, "", 2, "");
                        $('#unbind_box').addClass('hide');
                        window.sessionStorage.setItem("local_url","/base/CampusCard/bound/account_id/"+ account_id);
                        setTimeout(redirect, 2000);
                    } else {
                        fm.alert(res.message);
                        return false;
                    }
                }
            });
        });

        function redirect() {
            window.location.href = window.sessionStorage.getItem("local_url");
            window.sessionStorage.setItem("local_url", null);
        }
    });
</script>
<include file="commonJs" />
<include file="footer" />